﻿/*
 *Copyright(C) 2020 by  GYYX All rights reserved.
 *Unity版本：2018.4.23f1 
 *作者:程一峰  
 *创建日期: 2021-05-17 
 *模块说明：
 *版本: 1.2
*/


using UnityEngine;
using Warfare.FSM;

namespace WarfareEditor.FSM
{
    /// <summary>
    /// 添加节点的信息；
    /// </summary>
    public class FSM_AddNodeInfo
    {
        public string Name;


        public GUIContent Content;

        public static FSM_AddNodeInfo Create()
        {
            FSM_AddNodeInfo ret = new FSM_AddNodeInfo();
            ret.Name = "添加节点";
            ret.Content = new GUIContent(ret.Name);

            return ret;
        }

        #region 添加节点的执行方法

        public static FSMZoom_DesignMouseHandler Handler;

        public void AddNode()
        {
            if (Handler == null)
                return;

            var mousePosition = Handler.MousePosition;
            Debug.Log($"在此处添加节点：{mousePosition}");

            var node = new FSMNode();
            node.SetNodePosition(mousePosition);
            Handler.AddNode(node);
        }

        #endregion

    }
}
